home *** CD-ROM | disk | FTP | other *** search
- /* cos.c FUNCTION, FROM P. 206 OF TURBO C BIBLE */
- #include<math.h>
- #include<stdio.h>
- #include<stdlib.h> /* errno is defined here */
- #define R_TO_D 57.29578 /* radians to degree */
- main()
- {
- double angle, result;
- printf("-----------------Table of cosines------------------");
- printf("\t\tcosine\n");
- for(angle = 0.0; angle <= 180.0; angle += 10.0)
- {
- result = cos(angle / R_TO_D);
- printf("f deg.\t%f\n", angle, result);
- }
- }